<?php
	mysql_connect($globalDatabaseServer, $globalDatabaseUser, $globalDatabasePassword);
	mysql_select_db($globalDatabaseDatabase);
	
	function databaseGetSentEmails() {
		$query = mysql_query("SELECT * FROM emails WHERE sent is not NULL");
		$result = array();
		while ($data = @mysql_fetch_assoc($query)) {
			$result[$data['id']] = $data;
		}
		return $result;
	}
	
	function databaseRemoveEmail($email) {
		global $globalDebug;
		
		if ($globalDebug)
			print "Removing ".$email['id']."\n";
			
		mysql_query("DELETE FROM emails WHERE id='".$email['id']."'");
		
		print "-";
	}
?>